import BLE 
import myconfig
import sys
import mymqtt
import utime
import _thread
import app

myconfig.read_config()

print("unique_id="+myconfig.unique_id)
print('devic_id='+myconfig.devic_id)
print('client_id='+myconfig.client_id)
print('version='+myconfig.version)

print("start ble..")
BLE.start_ble()
print("start mqtt..")
_thread.start_new_thread(mymqtt.connect_mqtt, ())
print("start main..")
_thread.start_new_thread(app.run, ())

while True:
    if myconfig.type_net == 1:
        str = sys.stdin.readline()
        mymqtt.receive_cat1(str)
    else:
         utime.sleep_ms(10)

    




    

